package com.example.demo.ykj.counts;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface CountsRepository extends JpaRepository<Counts, Integer> {

    @Query(value = "SELECT suid,SUM(huji) as huji ,SUM(jjjz) as jjjz FROM `counts` GROUP BY suid", nativeQuery = true)
    List<Map<String, Object>> getStudent();
}